package com.kunbo.cn.service.impl.formprocess;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;

import com.kunbo.cn.dao.formprocess.ProfFormRelDao;
import com.kunbo.cn.entity.formprocess.ProfFormRel;
import com.kunbo.cn.service.formprocess.ProfFormRelService;

/**
 * <p>
 * 流程-表单关联表 服务实现类
 * </p>
 *
 * @author liuyu
 * @since 2018-01-17
 */
@Service
public class ProfFormRelServiceImpl implements ProfFormRelService {

	@Autowired
	private ProfFormRelDao profFormRelDao;
	
	@Override
	public Page<ProfFormRel> getPage(Pageable pageable) {
		// TODO Auto-generated method stub
		Page<ProfFormRel> list = profFormRelDao.getPage(pageable);
		return list;
	}

	@Override
	public List<ProfFormRel> findAll() {
		// TODO Auto-generated method stub
		List<ProfFormRel> list = (List<ProfFormRel>) profFormRelDao.findAll();
		return list;
	}

	@Override
	public ProfFormRel findByformTableName(String formTableName) {
		// TODO Auto-generated method stub
		return profFormRelDao.findByformTableName(formTableName);
	}

	@Override
	public ProfFormRel findById(Long id) {
		// TODO Auto-generated method stub
		return profFormRelDao.findOne(id);
	}

	@Override
	public void deleteById(Long id) {
		// TODO Auto-generated method stub
		profFormRelDao.delete(id);
	}

	@Override
	public ProfFormRel insertOrUpdate(ProfFormRel profFormRel) {
		// TODO Auto-generated method stub
		//return profFormRelDao.saveAndFlush(profFormRel);
		return profFormRelDao.save(profFormRel);
	}
	
	
	
	

}
